Microsoft DirectX 8.1 (C++)

Creating Simple Animations with the Bitmap Image

This topic applies to Windows XP Home Edition and Windows XP Professional only.

To create a simple animated bitmap logo, put all of the bitmap "frames" into a single image, as shown in the following illustration.

VMR Image Strip

When you set the bitmap initially using SetAlphaBitmap, if if the bitmap is in an HDC, set the rSrc field of the VMRALPHABITMAP structure to specify the size of the bitmap within the HDC. Top and left are 0, right and bottom are the width and height of the bitmap. If the bitmap is in a DirectDraw surface, then the size of the surface is known, so there is no need to specify rSrc in this method.

When you call UpdateAlphaBitmap, use the VMRALPHABITMAP.rSrc member for both HDC and DirectDraw bitmaps, to specify the particular "frame" or rectangle within the image that you wish to display, and set the VMRBITMAP_SRCRECT flag in the dwFlags member.